function plotTP_uvec_resonance(u,DU,moonName,res);

figure;
hold on
[ra,rp]=meshgrid(0:0.001:1.7);
Tisserand = 2./(ra+rp) + 2*sqrt(2*ra.*rp./(ra+rp));
N = length(u);
color = [1,0,0;...
         0,1,0;...
         0,0,1;...
         0,1,1;...
         1,1,0;...
         0.5,1,0;...
         1,0.5,0];



for ii = 1:N
    [L1,L2,L3,L4,L5] = librationPoints(u(ii));
    L_ = [L1,L2,L3,L4,L5];
    for jj = [1,5]
        % 1. Determine position of lagrange points
        
        L_pos = L_(:,jj);
        
        % 2. determine their jacobi's constants
        
        J_L(jj) = jacobiConst(L_pos,zeros(3,1),u(ii));
        
        % 3. plot using tisserand parameter
        
        contour(ra*DU(ii),rp*DU(ii),real(Tisserand),[J_L,J_L],'Color',color(ii,:),'LineWidth',1);
        
    end
    energyLevel = linspace(J_L(1),J_L(5),5);
    for jj = energyLevel
        contour(ra*DU(ii),rp*DU(ii),real(Tisserand),[jj,jj],'Color',color(ii,:),'LineWidth',1,'linestyle','-');
    end
    
end

y = linspace(0,1.7*DU(end),10);
x = @(y) y;
plot(x(y),y)
patch([x(y) fliplr(x(y))], [y max(ylim)*ones(size(y))], 'w')

% for ii = 1:N
%     text(DU(ii),DU(ii)+0.3*DU(ii),moonName{ii})
% end
for ii = 1:N
    
    for jj = 1:size(res,2)
        N = res(1,jj);
        M = res(2,jj);
        a = (N/M)^(2/3);
        xx(1:2)=[a 2*a];
        yy(1:2)=[a 0];
        plot(xx*DU(ii),yy*DU(ii),'Color',color(ii,:),'LineStyle','--','LineWidth',5)
        text(xx(1)*DU(ii),yy(1)*DU(ii),sprintf('%d:%d',N,M),'verticalAlignment','baseline','fontWeight','bold','fontsize',15);
    end
end
xlabel('ra');
ylabel('rp');
set(gca,'FontSize',20)
axis square
end